package com.ruoyi.credit.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.exception.user.Result;
import com.ruoyi.credit.entity.Credit;
import com.ruoyi.credit.service.CreditService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: 张桦阳
 * @Date: 2023-03-24-10:25:57
 * @Description: 类
 */
@RestController
@RequestMapping("/credit")
public class CreditController {

    @Resource
    private CreditService creditService;

    @RequestMapping("/findCredit")
    public Integer findCredit(@RequestParam("realname")String realname,@RequestParam("idcard")String idcard){
        QueryWrapper<Credit> wrapper = new QueryWrapper<>();
        wrapper.eq("realname", realname);
        wrapper.eq("idcard", idcard);
        Credit credit = creditService.getOne(wrapper);
        System.out.println(credit);
        return credit.getCredit();
    }
}
